package com.example.demo.commom;

import com.example.demo.entity.Userinfo;
import org.apache.catalina.User;
import org.springframework.http.HttpRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-10-14
 * Time:22:33
 */
//当我们想要通过Token获取用户信息时：
//public class UserSessionUtils {
//    public Integer getUserId(HttpServletRequest request) {
//
//        String token = request.getHeader("Authorization");
//        if(JWTUtils.checkToken(token)) {
//            //token验证通过后，我们就可按照我们工具类去获取用户信息了
//            return JWTUtils.getMemberIdByJwtToekn(token);
//        }
//
//    }
//}
